﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Gizmox.WebGUI.Forms;

namespace TVC
{
    [Serializable()]
    public abstract class CategoryNode
    {
        public CategoryNode(CategoryNode objParent, string strLabel, string address, string language)
        {
        }

        public virtual Control GetCategoryInstance(MainForm frm = null)
        {
            return null;
        }

        public virtual TreeNodeCollection Nodes
        {
            get
            {
                return null;
            }
        }

        public virtual CategoryNode AddCategory(string strLabel, string module, Type objType, string address, string language)
        {
            return new TypeCategoryNode(this, this.Nodes, strLabel, module, objType, address, language);
        }

        public virtual CategoryNode AddCategory(string strLabel, string module, Type objType, string strIcon, string address, string language)
        {
            return new TypeCategoryNode(this, this.Nodes, strLabel, module, objType, strIcon, address, language);
        }

        public virtual CategoryNode AddCategory(string strLabel, string module, string address, string language)
        {
            return new LogicalCategoryNode(this, this.Nodes, strLabel, module, address, language);
        }

        public virtual CategoryNode AddCategory(string strLabel, string module, string strIcon, string address, string language)
        {
            return new LogicalCategoryNode(this, this.Nodes, strLabel, module, strIcon, address, language);
        }

        public virtual void SetDefault()
        {
        }

        protected void Expand(TreeNode objNode)
        {
            if (objNode != null)
            {
                objNode.IsExpanded = true;
                objNode.Loaded = true;
                Expand(objNode.Parent);
            }
        }

        public virtual string Text
        {
            get
            {
                return "Category Node";
            }
            set { }
        }
        public string Address
        {
            get;
            set;
        }
        public string Command
        {
            get;
            set;
        }
        public string Language
        {
            get;
            set;
        }


    }
}
